          <select class="Select" name="category">
            <option value="">-- 请选择分类 --</option>
            <?php foreach($categories as $k => $category) : ?>
            <optgroup label="<?= $category->terms->name; ?>">
            <?php if(count($category->children) > 0) : ?>
                <?php foreach($category->children as $subCategory) : ?>
                <option value="<?= $subCategory->termTaxonomyId; ?>"<?php if($subCategory->termTaxonomyId == $this->selectedId) : ?> selected="selected"<?php endif; ?>><?= $subCategory->terms->name; ?></option>
                <?php endforeach; ?>
            <?php endif; ?>
            </optgroup>
            <?php endforeach; ?>
          </select>